//
//  IcRecommendation.m
//  IceClear
//
//  Created by P & C on 3/22/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "IcRecommendation.h"


@implementation IcRecommendation

@synthesize usageType;
@synthesize facilityType;
@synthesize temperature;
@synthesize precipitationType;
@synthesize materials;
@synthesize name;


-(id)initWithType:(NSUInteger)theType onFacilityOfType:(NSUInteger)theFacilityType 
	atTemperature:(NSUInteger)theTemperature forPrecipitationOfType:(NSUInteger)thePrecipitationType {
	self = [super init];
	
	if (self) {
		self->usageType = theType;
		self->temperature = theTemperature;
		self->facilityType = theFacilityType;
		self->precipitationType = thePrecipitationType;
	}
	
	return self;
}

- (void)encodeWithCoder:(NSCoder *)coder;
{
    [coder encodeObject:name forKey:@"name"];
    [coder encodeObject:materials forKey:@"materials"];
	[coder encodeInteger:usageType forKey:@"usageType"];
	[coder encodeInteger:facilityType forKey:@"facilityType"];
	[coder encodeInteger:precipitationType forKey:@"precipitationType"];
	[coder encodeInteger:temperature forKey:@"temperature"];
}

- (id)initWithCoder:(NSCoder *)coder;
{
    self = [super init];
    if (self != nil)
    {
        self->name = [[coder decodeObjectForKey:@"name"] retain];
        self->materials = [[coder decodeObjectForKey:@"materials"] retain];
		usageType = [coder decodeIntegerForKey:@"usageType"];
		facilityType = [coder decodeIntegerForKey:@"facilityType"];
		precipitationType = [coder decodeIntegerForKey:@"precipitationType"];
		temperature = [coder decodeIntegerForKey:@"temperature"];
		
    }   
    return self;
}


-(void)dealloc {
	[materials release];
	[name release];
	[super dealloc];
}

@end
